<?php

declare(strict_types=1);

namespace App\Controller\Rpc;
use App\Controller\AbstractController;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Service\SnowFlakeService\IdService;

/**
 * 分布式数据ID中心
 * @Controller(prefix="/Rpc/SnowFlake")
 */
class SnowFlakeController extends AbstractController
{
    /**
     * @RequestMapping(path="getLogID", methods="get")
     * 获取日志服务数据ID
     * @param RequestInterface $request
     */
    public function getLogID(RequestInterface $request)
    {
        return IdService::instance()->getLogID();
    }
    
    /**
     * @RequestMapping(path="getOmsID", methods="get")
     * 获取订单服务数据ID
     * @param RequestInterface $request
     */
    public function getOmsID(RequestInterface $request)
    {
        return IdService::instance()->getOmsID();
    }
    
    /**
     * @RequestMapping(path="getGoodsID", methods="get")
     * 获取商品服务数据ID
     * @param RequestInterface $request
     */
    public function getGoodsID(RequestInterface $request)
    {
        return IdService::instance()->getGoodsID();
    }
    
    /**
     * @RequestMapping(path="getOtherID", methods="get")
     * 获取其它服务数据ID
     * @param RequestInterface $request
     */
    public function getOtherID(RequestInterface $request)
    {
        return IdService::instance()->getOtherID();
    }
}